/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controller;
import bo.Product_BUS;
import dto.ProductDTO;
import com.opensymphony.xwork2.ActionSupport;
import java.util.ArrayList;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.interceptor.ServletRequestAware;

/**
 *
 * @author Tam Nguyen
 */
public class CoatAction extends ActionSupport implements ServletRequestAware{
    
    private HttpServletRequest request;
            
    public CoatAction() {
    }
    private ArrayList<dto.ProductDTO> list = new ArrayList();
    public ArrayList<ProductDTO> getList() {
        return list;
    }

    public void setList(ArrayList<ProductDTO> list) {
        this.list = list;
    }
    
    public String execute() throws Exception  {
        Product_BUS bus = new Product_BUS(); 
        int cate_id = Integer.parseInt(request.getParameter("category_id"));
        list = bus.LoadProduct(cate_id);
        return "success";
    }

    @Override
    public void setServletRequest(HttpServletRequest hsr) {
        request = hsr;
    }
}
